package com.hyjx.framework.common;

import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Properties;
import java.util.Set;

public class OrderedProperties extends Properties {
    private static final long serialVersionUID = -4627607243846121965L;
    private final LinkedHashSet<Object> keys = new LinkedHashSet();

    public OrderedProperties() {
    }

    public Enumeration<Object> keys() {
        return Collections.enumeration(this.keys);
    }

    public Object put(Object key, Object value) {
        this.keys.add(key);
        return super.put(key, value);
    }

    public Set<Object> keySet() {
        return this.keys;
    }

    public Set<String> stringPropertyNames() {
        Set<String> set = new LinkedHashSet();
        Iterator i$ = this.keys.iterator();

        while(i$.hasNext()) {
            Object key = i$.next();
            set.add((String)key);
        }

        return set;
    }
}